        // 渲染轮播图
        (function () {
            axios({
                url: '/banner',
                params: { type: 1 }
            }).then(res => {
                console.log('获取轮播图');
                console.log(res.data);
                res.data.banners.forEach((item, index) => {
                    // console.log(item.song);
                    let url = item.url !== null ? item.url = item.url : 'javascript:;';
                    $('.swiper-wrapper').append(`<div class="swiper-slide">
                        <a href=${url}><img src=${item.pic}></a>
                        </div>`)

                    $('.swiper-slide > a').click(function (e) {
                        //判断，如果item.song不等于null的情况下，取出id值
                        if (item.song) {
                            var { name, id } = item.song;
                            console.log(name + '----' + id);
                            axios({
                                url: '/check/music',
                                params: {
                                    id
                                }
                            }).then(res => {
                                console.log('检测音乐是否可用');
                                console.log(res.data);
                                let {
                                    message,
                                    success
                                } = res.data
                                return Promise.resolve(res.data);
                            }).then(res => {
                                console.log('函数我是第二个then');
                                if (res.success) {
                                    // 获取音乐 url
                                    axios({
                                        url: '/song/url',
                                        params: {
                                            id
                                        }
                                    }).then(res => {
                                        let url = ''
                                        console.log('函数获取音乐 url');
                                        console.log(res.data.data[0].url);
                                        url = res.data.data[0].url;
                                        // document.querySelector('audio').src = url;
                                        // 携带跳转至播放音乐界面
                                        location.href = '../song2.html?id=' + id + '';
                                    })
                                }

                            })
                                .catch(err => {
                                    console.error(err);
                                });

                        }

                    })
                    // swiper轮播图
                    var swiper = new Swiper('.swiper-container', {
                        centeredSlides: true,
                        loop: true,
                        pagination: {
                            el: '.swiper-pagination',
                            clickable: true,
                        },
                        autoplay: {
                            delay: 3000,
                            disableOnInteraction: false,
                        },
                        navigation: {
                            nextEl: '.swiper-button-next',
                            prevEl: '.swiper-button-prev',
                        },
                    });
                    //鼠标覆盖停止自动切换
                    swiper.el.onmouseover = function () {
                        swiper.autoplay.stop();
                    }
                    //鼠标离开开始自动切换
                    swiper.el.onmouseout = function () {
                        swiper.autoplay.start();
                    }
                    $('.swiper-wrapper').hover(() => {
                        $('.arrows').show();
                    }, () => {
                        $('.arrows').hide();
                    })
                });

            })
        })()
        // 拖拽功能
        $(".login_Window").on({
            mousedown: function (e) {
                var el = $(this);
                var os = el.offset(); dx = e.pageX - os.left, dy = e.pageY - os.top;
                $(document).on('mousemove.drag', function (e) {
                    el.offset({
                        top: e.pageY - dy, left: e.pageX - dx
                    });
                });
            }, mouseup: function (e) {
                $(document).off('mousemove.drag');
            }
        });
        // 眼睛的显示与关闭
            $('.glyphicon-eye-close').click(function (e) {
                e.preventDefault();
                console.log($(this).siblings('input')[0]);
                let input = $(this).siblings('input')[0]
                if (input.type === 'text') {
                    input.type = 'password'
                    this.classList.remove('glyphicon-eye-open');
                    this.classList.add('glyphicon-eye-close');
                } else {
                    input.type = 'text'
                    this.classList.remove('glyphicon-eye-close');
                    this.classList.add('glyphicon-eye-open');
                }
            });
   
        // header右侧对话框消失隐藏
        $('.toggle').hover(() => {
            $('.information').css({
                display: 'flex'
            })
        }, () => {
            $('.information').css({
                display: 'none'
            })
        })
        //选项卡
        $(function () {
            $('.right-warp>ul>li').on('click', function (e) {
                $(this).addClass('active').siblings().removeClass('active')
                let index = $(this).index();
                $('.right-warp .item').eq(index).show().siblings('.right-warp .item').hide();
            })
        })
